#ifndef Q_PCL_PLUGIN_HEADER
#define Q_PCL_PLUGIN_HEADER

#include "../ccStdPluginInterface.h"

//qCC
#include <mainwindow.h>

//PclUtils
#include <BaseFilter.h>



//Qt
#include <QObject>
#include <QtGui>

class QToolBar;
class QMenu;

//! PCL bridge plugin
class qPCL : public QObject, public ccStdPluginInterface
{
    Q_OBJECT
    Q_INTERFACES(ccStdPluginInterface)

public:
    
	//! Default constructor
    qPCL();

	//! Destructor
	virtual ~qPCL();

    //inherited from ccPluginInterface
    void getDescription(ccPluginDescription& desc);
	void newSelection(std::vector<ccHObject*>& selectedEntities);
    QIcon getIcon() const;

    //inherited from ccStdPluginInterface
    bool isEnabled(const std::vector<ccHObject*>& selectedEntities);
    int doAction(std::vector<ccHObject*>& selectedEntities,
                 unsigned& uiModificationFlags,
                 ccProgressDialog* progressCb=NULL,
                 QWidget* parent=NULL);
    QString getErrorMessage(int errorCode/*, LANGUAGE lang*/);

	//! Adds a filter
    int addFilter(BaseFilter* filter);
	void dispToConsole(QString* s);

public slots:
	//! Handles new entity
	void handleNewEntity(ccHObject*);

	//! Handles entity (visual) modification
	void handleEntityChange(ccHObject*);

	//! Handles new error message
	void handleErrorMessage(QString);

protected:

	//DGM: see below
	//int createToolbarAndMenu();
    
	//! Change flag
	//DGM: useless
    //bool m_is_first_activation;

	//! Toolbar
	QToolBar* m_toolbar;

	//! Menu
    QMenu* m_menu;

	//! qCC main window
	//DGM: dirty, a plugin can't have a direct access to the main qCC window/dialogs!
    //MainWindow* m_mainUI;

	//! Loaded filters
	std::vector<BaseFilter*> m_filters;

	//My Stuff


};


#endif//END Q_PCL_PLUGIN_HEADER
